package com.renli.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.renli.mapper.PunishmentMapper;
import com.renli.model.domain.Punishment;
import com.renli.result.R;
import com.renli.service.PunishmentService;
import org.springframework.stereotype.Service;

@Service
public class PunishmentServiceImpl extends ServiceImpl<PunishmentMapper, Punishment> implements PunishmentService {
    @Override
    public R pageDsscription(String description,int page,int size) {
        Page<Punishment> page1=new Page<>(page,size);
        LambdaQueryWrapper<Punishment> queryWrapper=new LambdaQueryWrapper<>();
        queryWrapper.like(description!=null,Punishment::getDescription,description);
        Page<Punishment> page2 = this.page(page1, queryWrapper);
        return new R(1,page2);
    }
}
